# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

# (1)
sum = 0
for i in range(1,101):
    if i % 2 == 0:
        sum += i
print(sum)

# (2)
sum = 0
for i in range(1,101,2):
    sum += i
print(sum)

# (3)
def is_prime(num):
    if num <= 1:
        return False
    for i in range(2,int(num**0.5)+1):
        if num % i == 0:
            return False
        return True
prime_number = [num for num in range(1,101) if is_prime(num)]
print("1到100以内的素数:", prime_number)